import hmac
import base64
from datetime import datetime
from hashlib import sha256

from django.conf import settings


def sign_verify():
    timestamp = datetime.now().timestamp()
    string_to_sign = str('1634267016688') + '\n' + 'b1FpC72JpLETceasCjsgkk_P_6eM3PnY9YZAoetmS3vutws02Us1t2DJeQn1D0XH'
    signature = base64.b64encode(hmac.new('b1FpC72JpLETceasCjsgkk_P_6eM3PnY9YZAoetmS3vutws02Us1t2DJeQn1D0XH'.encode(), string_to_sign.encode(), digestmod=sha256).digest())
    return signature


print(sign_verify())
